#include <iostream>
#include <typeinfo>
using namespace std;
struct Base {
  virtual ~Base() = default;
};
struct Derived : Base {};

int main() {
  Base b1;
  Derived d1;

  const Base *pb = &b1;
  std::cout << typeid(*pb).name() << '\n';
  pb = &d1;
  std::cout << typeid(*pb).name() << '\n';
  int i;
  double d;
  std::cout << typeid(i).name() << '\n';
  std::cout << typeid(d).name() << '\n';
  float f;
  std::cout << typeid(f).name() << '\n';
  unsigned u;
  std::cout << typeid(u).name() << '\n';
  bool b;
  std::cout << typeid(b).name() << '\n';

  double *dp = new double[4];
  cout << typeid(dp).name() << endl;
  // 并不改变原有的数据类型
  int *ip = reinterpret_cast<int *>(dp);
  cout << typeid(ip).name() << endl;
  cout << typeid(dp).name() << endl;
}